home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-15 | 725 b | 48 lines | [TEXT/PJMM] |
- unit MyMathUtils;
-
- interface
-
- function Max (a, b: longInt): longInt;
- function Min (a, b: longInt): longInt;
- function Pin (a, b, c: longInt): longInt;
- function Choose (cond: boolean; a, b: longInt): longInt;
-
- implementation
-
- function Max (a, b: longInt): longInt;
- begin
- if a > b then
- Max := a
- else
- Max := b;
- end;
-
- function Min (a, b: longInt): longInt;
- begin
- if a < b then
- Min := a
- else
- Min := b;
- end;
-
- function Pin (a, b, c: longInt): longInt;
- begin
- if b < a then
- Pin := a
- else if b > c then
- Pin := c
- else
- Pin := b;
- end;
-
- function Choose (cond: boolean; a, b: longInt): longInt;
- begin
- if cond then begin
- Choose := a;
- end
- else begin
- Choose := b;
- end;
- end;
-
- end.